   # 构建阶段
   FROM alpine:3.18 AS build-stage
   
   WORKDIR /app
   
   # 安装 Node.js 和 npm
   RUN apk add --no-cache nodejs npm
   
   # 安装 pnpm
   RUN npm install -g pnpm
   
   # 复制 package.json 和 pnpm-lock.yaml
   COPY package.json pnpm-lock.yaml ./
   
   # 安装依赖
   RUN pnpm install
   
   # 复制源代码
   COPY . .
   
   # 构建项目
   RUN pnpm build:pro
   
   # 生产阶段
   FROM nginx:stable-alpine AS production-stage
   
   # 复制构建产物到 nginx 目录
   COPY --from=build-stage /app/dist /usr/share/nginx/html
   
   # 复制 nginx 配置文件
   COPY nginx.conf /etc/nginx/conf.d/default.conf
   
   EXPOSE 80
   
   CMD ["nginx", "-g", "daemon off;"]